#! /bin/bash 
# 拉取可用镜像
docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.11.3
docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.11.3
docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.11.3
docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.11.3
docker pull mirrorgooglecontainers/pause:3.1
docker pull mirrorgooglecontainers/etcd-amd64:3.2.18
docker pull coredns/coredns:1.1.3

# 将镜像改名
docker tag mirrorgooglecontainers/kube-apiserver-amd64:v1.11.3             k8s.gcr.io/kube-apiserver-amd64:v1.11.3
docker tag mirrorgooglecontainers/kube-controller-manager-amd64:v1.11.3    k8s.gcr.io/kube-controller-manager-amd64:v1.11.3
docker tag mirrorgooglecontainers/kube-scheduler-amd64:v1.11.3             k8s.gcr.io/kube-scheduler-amd64:v1.11.3
docker tag mirrorgooglecontainers/kube-proxy-amd64:v1.11.3                 k8s.gcr.io/kube-proxy-amd64:v1.11.3
docker tag mirrorgooglecontainers/pause:3.1                                k8s.gcr.io/pause:3.1
docker tag mirrorgooglecontainers/etcd-amd64:3.2.18                        k8s.gcr.io/etcd-amd64:3.2.18
docker tag coredns/coredns:1.1.3                                           k8s.gcr.io/coredns:1.1.3

# 移除没用的镜像
docker image rm mirrorgooglecontainers/kube-apiserver-amd64:v1.11.3
docker image rm mirrorgooglecontainers/kube-controller-manager-amd64:v1.11.3
docker image rm mirrorgooglecontainers/kube-scheduler-amd64:v1.11.3
docker image rm mirrorgooglecontainers/kube-proxy-amd64:v1.11.3
docker image rm mirrorgooglecontainers/pause:3.1
docker image rm mirrorgooglecontainers/etcd-amd64:3.2.18
docker image rm coredns/coredns:1.1.3
